package kr.hkit.androidcomplete01.ch15;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

public class DisplayMetricsTest extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.ch15_displaymetricstest);
		
/*		DisplayMetrics dm = new DisplayMetrics(); 
		getWindowManager().getDefaultDisplay().getMetrics(dm);*/
		
		DisplayMetrics dm = getResources().getDisplayMetrics();
		String str = "widthPixels=" + dm.widthPixels +
				"\nheightPixels" + dm.heightPixels + 
				"\ndenisityDpi" + dm.densityDpi + 
				"\ndensity" + dm.density + 
				"\nscaledDensity" + dm.scaledDensity +
				"\nxdpi" + dm.xdpi + 
				"\nydpi" + dm.ydpi;
		TextView info = (TextView) findViewById(R.id.result);
		info.setText(str);
	}
}
